package com.packet.cheng.queue.consumer;
/**
 @author zaicheng
 @version 1.0
 @date 2022-04-19
 @email zzc15847256473@163.com
 */

import com.alibaba.fastjson.JSONObject;
import com.packet.cheng.consts.RedConsts;
import com.packet.cheng.vo.RedPacketReocrdVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;

/*
@Component
@Slf4j
public class RedPacketConsumer {


    @RabbitListener(containerFactory = "redRabbitConnectionFactory",queues = {RedConsts.RECEIVE_RED_RECORD_QUEUE})
    public  void  redPacketRecord(Message  message){

        log.error("接收到拆红包方的红包发送邀请：{}",message);

        String redMsg = new String(message.getBody(), StandardCharsets.UTF_8);

        RedPacketReocrdVo reocrdVo = JSONObject.parseObject(redMsg, RedPacketReocrdVo.class);

        //红包记录入库操作

    }
}
*/
